package com.ndp.fb.enums.message;

import lombok.Getter;

/**
 * Created by elvisxiong on 7/23/15.
 */
@Getter
public enum EventNotificationType {

    //token无效
    TOKEN_INVALID(0,"Token失败提醒","权限变更提醒"),
    //主页、应用、用户权限变更
    AUTHORITY_ALTERATION(1,"权限变更提醒","Permission change alert"),
    //广告发布失败
    AD_PUBLISH_FAILURE(2,"广告发布失败提醒","Advertising fails to remind"),
    //通知
    ANNOUNCEMENT(3,"系统通知","System notification"),
    /**
     * 广告优化失败提醒
     */
    AD_OPTIMIZATION_FAILURE(4,"广告优化失败提醒","Advertising optimization failed to remind");

    private int type;
    private String name;
    private String enName;
    EventNotificationType(int type,String name,String enName){
        this.type = type;
        this.name = name;
        this.enName = enName;
    }

    public static EventNotificationType getEventNotificationType(int type){
        for (EventNotificationType event: EventNotificationType.values()) {
            if (event.getType()==type) {
                return event;
            }
        }
        return  null;
    }

    @Override
    public String toString() {
        return ""+this.type;
    }
}
